package com.company.gxcpc2018;

import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.IntStream;

public class Gxcpc3 {
    /**
     * 队员能力值
     */
    static int[] a;
    /**
     * 金牌能力值
     */
    static int value = 18;
    static int[] b = new int[3];
    static boolean[] flag;
    static int num = 0;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        while (t-- > 0) {
            int n = sc.nextInt();
            value = sc.nextInt();
            a = IntStream.generate(sc::nextInt).limit(n).toArray();
            flag = new boolean[a.length];
            Arrays.sort(a);
            num = 0;
            fun(0);
            System.out.println(num);
        }
    }


    static void println() {
        int sum = 0;

        sum += a[b[0]] + 2 * a[b[1]] + 3 * a[b[2]];

        if (sum < value) {
            return;
        }
        if (flag[b[0]] || flag[b[1]] || flag[b[2]]) {
            return;
        }
        flag[b[0]] = true;
        flag[b[1]] = true;
        flag[b[2]] = true;
        num++;
    }

    static int bIndex = 0;

    public static void fun(int index) {
        if (bIndex == 3) {
            println();
            return;
        }
        if (index == a.length) {
            return;
        }
        b[bIndex++] = index;
        fun(index + 1);
        bIndex--;
        fun(index + 1);

    }
}
